package homework;

public class TestLotsConstructionFun {
    private String name;
    private int age;
    private String color;

    /**
     * 无参构造
     */
    public TestLotsConstructionFun() {
        this.name = "小黑";
        this.age = 2;
        this.color = "black";
    }

    /**
     * 两个参数的构造方法
     * @param name
     * @param age
     */
    public TestLotsConstructionFun(String name, int age) {
        this.name = name;
        this.age = age;
    }

    /**
     * 三个参数的构造方法
     * @param name
     * @param age
     * @param color
     */
    public TestLotsConstructionFun(String name, int age, String color) {
        this.name = name;
        this.age = age;
        this.color = color;
    }

    @Override
    public String toString() {
        return "TestLotsConstructionFun{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", color='" + color + '\'' +
                '}';
    }
}

class Test {
    public static void main(String[] args) {
        TestLotsConstructionFun testLotsConstructionFun = new TestLotsConstructionFun();
        TestLotsConstructionFun testLotsConstructionFun1 = new TestLotsConstructionFun("小白", 1);
        TestLotsConstructionFun testLotsConstructionFun2 = new TestLotsConstructionFun("小灰", 2, "grey");
        System.out.println(testLotsConstructionFun);
        System.out.println(testLotsConstructionFun1);
        System.out.println(testLotsConstructionFun2);
    }
}